package ui.mainscreen.listeners;

import java.awt.BorderLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import ui.ScreenPanelManager;
import ui.ScreenPanelManager.ID;
import ui.mainscreen.MenuPanel;
import ui.mainscreen.MainScreenPanel;
import ui.mainscreen.OptionPanel;

/**
 * Слушатель нажатий кнопки Опций
 * 
 * @author Anton
 */
public class OptionButtonListener implements ActionListener {

	private OptionPanel option;
	private MenuPanel menuPanel;
	private MainScreenPanel mainScreenPanel;

	public OptionButtonListener(OptionPanel option, MenuPanel menuPanel, MainScreenPanel mainScreenPanel) {
		this.option = option;
		this.menuPanel = menuPanel;
		this.mainScreenPanel=mainScreenPanel;
	}

	@Override
	public void actionPerformed(ActionEvent arg0) {

		ScreenPanelManager manager = ScreenPanelManager.getInstance();
		mainScreenPanel.add(option);
		option.setVisible(true);

		mainScreenPanel.revalidate();
		menuPanel.menuCreatorButton.setEnabled(false);
		menuPanel.menuLoadButton.setEnabled(false);
		menuPanel.menuNewButton.setEnabled(false);
		menuPanel.menuExitButton.setEnabled(false);
		menuPanel.menuOptionButton.setEnabled(false);

	}

}
